home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #14 / Monster Media No. 14 (April 1996) (Monster Media, Inc.).ISO / math / maca_101.zip / INTEG.DEM < prev    next >
Text File  |  1996-01-30  |  1KB  |  38 lines

  1. ;INTEG.DEM
  2. ;DEMO FILE FOR MASSCALC VERSION 1.00
  3. ;WRITTEN BY: Ralph W. Reid
  4. ;This file may only be distributed in its unmodified form.
  5. ;
  6. ;DESCRIPTION:  This file primarily demonstrates integral calculations.
  7. ;
  8. ;For the latest releases of MASSCALC and other software created by
  9. ;Ralph W. Reid, see http://www2.athenon.com/~rreid/products/00-index.html.
  10. ;
  11. ;HOW TO USE THIS FILE:  This file may be piped into MASSCALC, and its
  12. ;output displayed as follows:
  13. ;TYPE INTEG.DEM | MASSCALC | MORE
  14. ;This file may be redirected into MASSCALC and its output displayed
  15. ;as follows:
  16. ;MASSCALC < INTEG.DEM | MORE
  17. ;These two commands should be run from the operating system prompt.
  18.  
  19. ;calculate the integral of an equation
  20. ;integ_a_simpson parameters are variable name, low, high, function
  21. print: "Integral of 2*x from 0 through 2:" integ_a_simpson (x, 0, 2, 2*x);
  22.  
  23. ;calculate the same equation using a list
  24. create array: list (1, 3);
  25. list = 0, 2, 4;
  26. print:
  27. print: "Finding integral with list:" list
  28. print: "Integral =" integ_list (1, list);
  29.  
  30. ;calculate the area under a horizontal line
  31. redimension array: list [1, 4];
  32. list = 2, 2, 2, 2;
  33. print:
  34. print: "Finding the integral under a horizontal line:"
  35. print: "The initial list is " list
  36. print: "The integral of this list is" integ_list (1, list)
  37.  
  38.